<cfcomponent extends="Controller">
	<cffunction name="eligibilityReferralAdmission">
		<cfscript>
			var documentID = 9;		
			document = getInsuranceDocument(documentID);
		</cfscript>
	</cffunction>
	
	<cffunction name="consent">
		<cfscript>
			var documentID = 8;
			document = getInsuranceDocument(documentID);
		</cfscript>
	</cffunction>
	
	<cffunction name="rightsResponsibilities">
		<cfscript>
			var documentID = 7;
			document = getInsuranceDocument(documentID);
		</cfscript>
	</cffunction>
	
	<cffunction name="rulesRegulations">
		<cfscript>
			var documentID = 6;
			document = getInsuranceDocument(documentID);
		</cfscript>
	</cffunction>
	
	<cffunction name="universal">
		<cfscript>
			var documentID = 5;
			document = getInsuranceDocument(documentID);
		</cfscript>
	</cffunction>

	<cffunction name="getInsuranceDocument">
		<cfargument name="documentID" default="0">
		<cfscript>
			consumer = Model("consumer").findByKey(key=PARAMS.key, returnAs="query");
			insuranceDocuments = Model("document").findAll(include="insurance", where="id=#ARGUMENTS.documentID# AND consumerID=#PARAMS.key#");
		</cfscript>
		<cfquery name="document" dbtype="query">
			SELECT 	*, (consumer.firstName + ' ' + consumer.lastName) [consumerName]
			FROM 	insuranceDocuments, consumer 
			WHERE 	insuranceDocuments.consumerID = consumer.id
		</cfquery>
		<cfreturn document>
	</cffunction>
</cfcomponent>